2eb3c3c8336ac46deb9f80637e9f2b66d440a1ee,src/test/java/com/datalogics/pdf/samples/manipulation/MergeDocumentsTest.java,MergeDocumentsTest,checkPages,#PDFDocument#,61
Before Change
// Compare the output page count to the sum of the input file page counts
private void checkPages(final PDFDocument outputDoc) throws Exception {
final int pagesFirst = getPdfFromResource(MergeDocuments.FIRST_DOCUMENT).requirePages().getCount();
final int pagesSecond = getPdfFromResource(MergeDocuments.SECOND_DOCUMENT).requirePages().getCount();
assertEquals("The merged document should contain pages equal to the sum of the source documents",
pagesFirst + pagesSecond, outputDoc.requirePages().getCount());
}
After Change
// Compare the output page count to the sum of the input file page counts
private void checkPages(final PDFDocument outputDoc) throws Exception {
final URL firstDocument = MergeDocuments.class.getResource(MergeDocuments.FIRST_DOCUMENT);
final URL secondDocument = MergeDocuments.class.getResource(MergeDocuments.SECOND_DOCUMENT);
final int pagesFirst = DocumentUtils.openPdfDocument(firstDocument).requirePages().getCount();
final int pagesSecond = DocumentUtils.openPdfDocument(secondDocument).requirePages().getCount();
assertEquals("The merged document should contain pages equal to the sum of the source documents",
pagesFirst + pagesSecond, outputDoc.requirePages().getCount());
}